package com.yiwei.ydd.util;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Handler;
import android.support.v7.widget.RecyclerView;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.ScrollingMovementMethod;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.allen.library.SuperButton;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.target.Target;
import com.yiwei.ydd.R;
import com.yiwei.ydd.adapter.OilRechargeTypeAdapter;
import com.yiwei.ydd.adapter.RechargeDetailAdapter;
import com.yiwei.ydd.api.model.PaymentListModel;
import com.yiwei.ydd.api.model.RechargeTermDetailModel;
import com.yiwei.ydd.view.CircularProgress;

import java.util.ArrayList;
import java.util.List;


/**
 * 自定义对话框
 * Created by Master.Dong on 2016/4/13.
 */
public class Dialog {


    /**
     * 显示无标题的默认按钮
     *
     * @param context             上下文
     * @param content             内容
     * @param leftButton          左边按钮
     * @param rightButton         右边按钮
     * @param dialogClickListener 点击事件回调
     * @return
     */
    public static android.app.Dialog showDefaultDialog(Context context, String title, String content,
                                                       String leftButton, String rightButton, boolean showCloseBtn,
                                                       final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.default_dialog, null);
        dialog.setContentView(view);
        LinearLayout titleView = (LinearLayout) view.findViewById(R.id.title_view);
        TextView mTitle = (TextView) view.findViewById(R.id.title);
        TextView mContext = (TextView) view.findViewById(R.id.content);
        TextView mLeftBtn = (TextView) view.findViewById(R.id.left_button);
        TextView mClose = (TextView) view.findViewById(R.id.close);
        if (showCloseBtn) mClose.setVisibility(View.VISIBLE);
        else mClose.setVisibility(View.INVISIBLE);

        //标题
        if (TextUtils.isEmpty(title))
            mTitle.setVisibility(View.GONE);
        else {
            titleView.setVisibility(View.VISIBLE);
            mTitle.setText(title);
        }
        //内容
        if (TextUtils.isEmpty(content)) {
            mContext.setVisibility(View.GONE);
            ((View) view.findViewById(R.id.line)).setVisibility(View.VISIBLE);
        } else {
            mContext.setVisibility(View.VISIBLE);
            mContext.setText(content);
        }

        //左边按钮
        if (TextUtils.isEmpty(leftButton)) {
            mLeftBtn.setVisibility(View.GONE);
            ((View) view.findViewById(R.id.d_line)).setVisibility(View.GONE);
        } else {
            mLeftBtn.setVisibility(View.VISIBLE);
            mLeftBtn.setText(leftButton);
        }
        ((TextView) view.findViewById(R.id.right_button)).setText(rightButton);
        dialog.setCancelable(false);
        view.findViewById(R.id.left_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.cancel();
                            }
                        }, 200);
                    }
                });
        view.findViewById(R.id.right_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.confirm();
                            }
                        }, 200);
                    }
                });
        mClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });
        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    public static android.app.Dialog showDefaultOneBtnDialog(Context context, String content,
                                                             String rightButton,
                                                             final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.default_one_btn_dialog, null);
        dialog.setContentView(view);
        LinearLayout titleView = (LinearLayout) view.findViewById(R.id.title_view);
        TextView mTitle = (TextView) view.findViewById(R.id.title);
        SuperButton mContext = (SuperButton) view.findViewById(R.id.content);


        //内容
        if (TextUtils.isEmpty(content)) {
            mContext.setVisibility(View.GONE);
            ((View) view.findViewById(R.id.line)).setVisibility(View.VISIBLE);
        } else {
            mContext.setVisibility(View.VISIBLE);
            mContext.setText(content);
        }


        ((TextView) view.findViewById(R.id.right_button)).setText(rightButton);
        dialog.setCancelable(false);
        view.findViewById(R.id.right_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.confirm();
                            }
                        }, 200);
                    }
                });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showDefaultEditDialog(Context context, String title, String hintContent,
                                                           String leftButton, String rightButton,
                                                           final DialogEditClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.default_edit_dialog, null);
        dialog.setContentView(view);
        LinearLayout titleView = (LinearLayout) view.findViewById(R.id.title_view);
        TextView mTitle = (TextView) view.findViewById(R.id.title);
        EditText mContext = (EditText) view.findViewById(R.id.content);
        TextView mLeftBtn = (TextView) view.findViewById(R.id.left_button);
        TextView mClose = (TextView) view.findViewById(R.id.close);


        //标题
        if (TextUtils.isEmpty(title))
            mTitle.setVisibility(View.GONE);
        else {
            titleView.setVisibility(View.VISIBLE);
            mTitle.setText(title);
        }
        //内容
        if (TextUtils.isEmpty(hintContent)) {
            mContext.setVisibility(View.GONE);
            ((View) view.findViewById(R.id.line)).setVisibility(View.VISIBLE);
        } else {
            mContext.setVisibility(View.VISIBLE);
            mContext.setHint(hintContent);
        }

        //左边按钮
        if (TextUtils.isEmpty(leftButton)) {
            mLeftBtn.setVisibility(View.GONE);
            ((View) view.findViewById(R.id.d_line)).setVisibility(View.GONE);
        } else {
            mLeftBtn.setVisibility(View.VISIBLE);
            mLeftBtn.setText(leftButton);
        }
        ((TextView) view.findViewById(R.id.right_button)).setText(rightButton);
        dialog.setCancelable(false);
        view.findViewById(R.id.left_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.cancel();
                            }
                        }, 200);
                    }
                });
        view.findViewById(R.id.right_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.confirm(UI.toString(mContext));
                            }
                        }, 200);
                    }
                });
        mClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });
        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showQrCodeDownloadTips(Context context, final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_download_qrcode, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);


        view.findViewById(R.id.btn_download).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogClickListener != null) {
                    dialogClickListener.confirm();
                }
                dialog.dismiss();
            }
        });

        view.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.gravity = Gravity.BOTTOM;
        lp.width = Util.getDisplayMetrics(context).widthPixels;

        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showCommissionTips(Context context) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_commission_tips, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);


        view.findViewById(R.id.btn_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.gravity = Gravity.BOTTOM;
        lp.width = Util.getDisplayMetrics(context).widthPixels;

        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    public static android.app.Dialog showVipPacketTips(Context context) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_vip_packet_tips, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);


        view.findViewById(R.id.btn_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.gravity = Gravity.BOTTOM;
        lp.width = Util.getDisplayMetrics(context).widthPixels;

        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    public static android.app.Dialog showYouhuiTips(Context context) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_youhui_tips, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);


        view.findViewById(R.id.btn_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.gravity = Gravity.BOTTOM;
        lp.width = Util.getDisplayMetrics(context).widthPixels;

        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showTipsDialog(Context context, String title, String content,
                                                    final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_tips, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);

        ((TextView) view.findViewById(R.id.txt_title)).setText(title);
        ((TextView) view.findViewById(R.id.txt_content)).setText(content);
        view.findViewById(R.id.left_button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                dialogClickListener.cancel();
            }
        });
        view.findViewById(R.id.right_button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                dialogClickListener.confirm();
            }
        });
        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    public static android.app.Dialog showRechargeDetailDialog(Context context, List<RechargeTermDetailModel.DatasBean> datasBeanList,
                                                              final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_recharge_detail, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);
        RechargeDetailAdapter adapter = new RechargeDetailAdapter(context);
        RecyclerView listdata = (RecyclerView) view.findViewById(R.id.list);
        listdata.setAdapter(adapter);

        adapter.update(datasBeanList);
        view.findViewById(R.id.btn_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                if (dialogClickListener != null) {
                    dialogClickListener.cancel();
                }
            }
        });
        view.findViewById(R.id.btn_question).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Dialog.showDefaultDialog(context, "", "到账总额为\n加油套餐充值每月返现+每月赠送金额+加油包每个月返现的总额", "", "明白了", false, new DialogDefaultClickListener() {
                    @Override
                    public void confirm() {

                    }

                    @Override
                    public void cancel() {

                    }
                });
            }
        });
        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.width = (int) (Util.getDisplayMetrics(context).widthPixels * 0.85);

        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showRechargeTypeDialog(Context context, List<PaymentListModel.DatasBean> datasBeanList,
                                                            final DialogPaymentClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_recharge_type, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);
        OilRechargeTypeAdapter adapter = new OilRechargeTypeAdapter(context);
        adapter.setOnChooseListener(new OilRechargeTypeAdapter.OnChooseListener() {
            @Override
            public void onClick(String name, String id) {

                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        if (dialogClickListener != null) {
                            dialogClickListener.confirm(name, id);
                        }
                        dialog.dismiss();
                    }
                }, 200);

            }
        });
        RecyclerView listdata = (RecyclerView) view.findViewById(R.id.list);
        listdata.setAdapter(adapter);
        adapter.update(datasBeanList);

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        lp.width = (int) (Util.getDisplayMetrics(context).widthPixels * 0.85);

        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showVersionDialog(Context context, String content, boolean isForce,
                                                       final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_version_update, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);

        if (isForce) {
            view.findViewById(R.id.left_button).setVisibility(View.GONE);
        } else {
            view.findViewById(R.id.left_button).setVisibility(View.VISIBLE);
        }
        ((TextView) view.findViewById(R.id.txt_content)).setText(content);
        view.findViewById(R.id.left_button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                dialogClickListener.cancel();
            }
        });
        view.findViewById(R.id.right_button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
                dialogClickListener.confirm();
            }
        });
        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    //显示大头像
    public static android.app.Dialog showBigIcon(Context context, String url) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_show_icon_progress, null);
        ImageView photoView = (ImageView) view.findViewById(R.id.photo);
        CircularProgress progressBar = (CircularProgress) view.findViewById(R.id.progressBar);
        Glide.with(context).load(url).listener(new RequestListener<String, GlideDrawable>() {
            @Override
            public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
                progressBar.setVisibility(View.GONE);
                return false;
            }

            @Override
            public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
                photoView.setImageDrawable(resource);
                progressBar.setVisibility(View.GONE);
                return false;
            }
        }).into(photoView);
        dialog.setContentView(view);
        photoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialog.dismiss();
            }
        });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }


    public static android.app.Dialog showSetGuestureSuccessDialog(Context context, DialogClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.dialog_guesture_success, null);
        dialog.setContentView(view);
        dialog.setCancelable(false);

        view.findViewById(R.id.btn_submit).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogClickListener != null) {
                    dialogClickListener.confirm();
                }
                dialog.dismiss();
            }
        });
        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    public static android.app.Dialog showGuestrueDialog(Context context, String title, String content,
                                                        String leftButton, String rightButton,
                                                        final DialogDefaultClickListener dialogClickListener) {
        final android.app.Dialog dialog = new android.app.Dialog(context,
                R.style.DialogStyle);
        View view = LayoutInflater.from(context)
                .inflate(R.layout.default_guesture_dialog, null);
        dialog.setContentView(view);

        SuperButton mTitle = (SuperButton) view.findViewById(R.id.txt_title);
        SuperButton mContext = (SuperButton) view.findViewById(R.id.content);
        SuperButton mLeftBtn = (SuperButton) view.findViewById(R.id.left_button);


        //标题
        if (TextUtils.isEmpty(title)) {
            mTitle.setVisibility(View.GONE);
            mContext.setShapeCornersTopLeftRadius(5).setShapeCornersTopRightRadius(5).setUseShape();
        } else {
            mTitle.setText(title);
        }
        //内容
        if (TextUtils.isEmpty(content)) {
            mContext.setVisibility(View.GONE);
        } else {
            mContext.setVisibility(View.VISIBLE);
            mContext.setText(content);
        }

        //左边按钮
        if (TextUtils.isEmpty(leftButton)) {
            mLeftBtn.setVisibility(View.GONE);
            ((View) view.findViewById(R.id.d_line)).setVisibility(View.GONE);
        } else {
            mLeftBtn.setVisibility(View.VISIBLE);
            mLeftBtn.setText(leftButton);
        }
        ((SuperButton) view.findViewById(R.id.right_button)).setText(rightButton);
        dialog.setCancelable(false);
        view.findViewById(R.id.left_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.cancel();
                            }
                        }, 200);
                    }
                });
        view.findViewById(R.id.right_button).setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View arg0) {
                        dialog.dismiss();
                        new Handler().postDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dialogClickListener.confirm();
                            }
                        }, 200);
                    }
                });

        Window mWindow = dialog.getWindow();
        WindowManager.LayoutParams lp = mWindow.getAttributes();
        if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {// 横屏
            lp.width = Util.getDisplayMetrics(context).heightPixels / 10 * 8;
        } else {
            lp.width = Util.getDisplayMetrics(context).widthPixels / 10 * 8;
        }
        mWindow.setAttributes(lp);
        dialog.show();
        return dialog;
    }

    public interface DialogClickListener {
        public abstract void confirm();

    }

    public interface DialogPaymentClickListener {
        public abstract void confirm(String en_name, String id);

    }

    public interface DialogDefaultClickListener {
        public abstract void confirm();

        public abstract void cancel();
    }

    public interface DialogEditClickListener {
        public abstract void confirm(String content);

        public abstract void cancel();
    }

    public interface DialogSystemDefaultClickListener {
        public abstract void confirm();

        public abstract void cancel();

        public abstract void close();
    }


    public interface IdCardClickListener {
        public abstract void confirm(String name, String address);

        public abstract void cancel();
    }


}
